package csu.jpetstore.jpetstore.controller;

import csu.jpetstore.jpetstore.domain.Item;
import csu.jpetstore.jpetstore.result.Result;
import csu.jpetstore.jpetstore.result.ResultFactory;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping(value = "/api")
public class ItemController {
    @RequiresRoles({"admin","saler"})
    @RequiresAuthentication
    @PostMapping("/item")
    public Result addItem(@RequestBody Item item){
        return ResultFactory.getSuccess("success",null);
    }
}
